<template>
  <image-viewer
    :z-index="zIndex"
    :initial-index="imageIndex"
    v-if="data.state"
    :on-close="closeViewer"
    :url-list="data.list"
  />
</template>
<script>
import ImageViewer from 'element-ui/packages/image/src/image-viewer';
export default {
  name: "PreviewBox",
  props: {
    data:{
      type:Object,
    },
  }, // 获取父组件数据
  components: {
    ImageViewer,
  },
  created() {

  },
  data() {
    return {
      zIndex:9999,
      imageIndex:0,
    };
  },
  methods: {
    closeViewer(){
      this.data.state=false
    },
  },
  computed: {

  }
};
</script>
<style  lang="scss" scoped>
</style>
